package com.oa.admin.service;

import com.joneying.common.web.response.Resp;
import com.oa.admin.dto.DormAddDTO;
import com.oa.admin.dto.DormApprovalDTO;
import com.oa.admin.dto.DormConditionDTO;
import com.oa.admin.vo.DormListVO;
import com.oa.core.PageResult;
import com.oa.admin.entity.Dorm;
import com.baomidou.mybatisplus.service.IService;
import com.oa.core.exception.BusinessException;
import com.oa.core.exception.DataIsEmptyException;

/**
 * <p>
 * 宿舍申请表 服务类
 * </p>
 *
 * @author syb123
 * @since 2019-01-22
 */
public interface IDormService extends IService<Dorm> {
    /**
     * 自定义分页
     *
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageResult<Dorm> findList(Integer pageNum, Integer pageSize);

    /**
     * 根据id查询
     */
    Dorm findDormById(String id);


    /**
     * 提交宿舍申请
     *
     * @param dormAddDTO
     * @return
     */
    Resp addDorm(String userId, DormAddDTO dormAddDTO) throws BusinessException, DataIsEmptyException;

    /**
     * 根据条件查询宿舍申请
     *
     * @param dormConditionDTO
     * @return
     */
    PageResult<DormListVO> findDormListByCondition(DormConditionDTO dormConditionDTO);

    /**
     * 根据id查询宿舍申请详情
     *
     * @param id
     * @return
     */
    Resp findDormDetailsById(String id) throws DataIsEmptyException;

    /**
     * 宿舍申请审批(审批后)
     *
     * @param dormApprovalDTO
     * @return
     */
    Resp dormApproval(DormApprovalDTO dormApprovalDTO) throws BusinessException, DataIsEmptyException;


    /**
     * 导出宿舍申请列表
     *
     * @return
     */
    Resp exportDormApplicationList() throws BusinessException;
}
